home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload Trio 2 / Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO / dir41 / sharefix.zip / SHAREFIX.DOC < prev    next >
Text File  |  1993-12-27  |  8KB  |  186 lines

  1. ************************************************************************
  2. ** SHAREFIX.DOC - short and dirty documentation to SHAREFIX           **
  3. **                                                                    **
  4. ** (c) 1993 Andrzej Górbiel                                           **
  5. ************************************************************************
  6.  
  7. What is SHAREFIX?
  8.  
  9. It is a set of tools that fix many problems resulting from usage of SHARE
  10. with most old DOS applications in multitasking environment (e.g. Windows).
  11. I would never use SHARE on my single user, isolated computer because
  12. it takes some memory and causes many troubles but there are some programs
  13. that cannot work without SHARE (e.g. Microsoft Word for Windows 6.0!).
  14.  
  15.  
  16. There are two unpleasant things about SHARE:
  17.  
  18. 1. If a process dies before closing file it will remain open and LOCKED
  19.    forever i.e. until you reboot. And I believe you will agree that
  20.    booting PC with lots of drivers, TSRs, multiple configurations utils,
  21.    virus scanners and Windows itself is not a funny job!
  22.  
  23. 2. Most traditional DOS applications open files in the so called
  24.    "compatibility mode" (without sharing flags) that means:
  25.  
  26.    - once file is opened such way it cannot be open for sharing
  27.      e.g. Windows is unable to read such file
  28.  
  29.    - once file is open for sharing it cannot be open in compatibility
  30.      mode even if process that open for sharing allows others read and write!
  31.      This means:
  32.        * you cannot view any file that is used by Windows
  33.        * you cannot copy even a font file that is loaded
  34.        * it is dangerous to search any information using DOS utils
  35.          because they will issue a critical error each time they
  36.          try to access Windows executable, DLL, driver, font file
  37.          or any document that is open
  38.        * you can get a heart attack because some of DOS programs
  39.          will suggest you formatting your hard disk
  40.  
  41. I have observed still other problems with SHARE:
  42.  
  43.  - some older programs written in Turbo Pascal exit with "Runtime error"
  44.    with a number corresponding to "invalid file handle"; anyway I would
  45.    suggest to recompile such programs but it is not possible if you
  46.    have no sources
  47.  
  48.  - some DOS programs that keep data files or configuration files open
  49.    cannot be started in two DOS sessions; sometimes you should not do that
  50.    but in many cases it is quite normal
  51.  
  52.  
  53. All problems described above will be (hopefully!) fixed by one of
  54. the following tools:
  55.  
  56. --------
  57. SHAREDIR
  58. --------
  59. This program displays detailed list of files maintained by SHARE. This is
  60. not the same list that some other tools (e.g. Quarterdeck's Manifest) show.
  61. You can find from this list which file became open and locked forever.
  62. Example of output produced by SHAREDIR:
  63.  
  64.  PATH                                                             LOCKS MODE VM
  65.  ------------------------------------------------------------------------------
  66.  C:\NC\NC.INI                                                         0 0042  2
  67.  C:\WINDOWS\SYSTEM\WINOA386.MOD                                       0 1042  1
  68.  C:\WINDOWS\SYSTEM\DOSAPP.FON                                         0 1042  1
  69.  C:\WINDOWS\SYSTEM\KRNL386.EXE                                        0 1042  1
  70.  WIN$EXEC                                                             0 00C0  1
  71.  C:\WINDOWS\SYSTEM\W800.DRV                                           0 1042  1
  72.  C:\WINDOWS\SYSTEM\COURP.TTF                                          0 1042  1
  73.  C:\WINDOWS\SYSTEM\USER.EXE                                           0 1042  1
  74.  
  75. First column is a fully qualified canonical name of file (all SUBSTs,
  76. ASSIGNs, JOINs are resolved) unless a file is a character device
  77. (in this example WIN$EXEC).
  78.  
  79. Second column is a number of LOCKS (number of locked regions in file).
  80. Not many programs use locks but I had a lot of problems with Word 6.0
  81. before I found that it cannot save documents in its new format
  82. if you do not give it at least a hundred of locks (SHARE /L:100).
  83.  
  84. Third column is not even undocumented but it seems to have something
  85. to do with DOS open mode (less significant byte).
  86.  
  87. The last column is a identifier of Virtual Machine that opened a file.
  88. Under Windows 3.1 it is 0-for resident DOS (you should not see it often!),
  89. 1-for Windows, >=2-for all other DOS sessions. Beware: if you kill a DOS
  90. session its number will be reused soon making you think that some forgotten
  91. file was open by innocent DOS program.
  92.  
  93.  
  94.  
  95. -----
  96. CLOSE
  97. -----
  98. This command allows you to close file by its name. You will no longer
  99. have to reboot after some files remain open forever. If you decide
  100. to close a file just pick its name from a list of files printed
  101. by SHAREDIR. Please use complete path unless file is in a current
  102. directory. CLOSE will resolve all SUBSTs for you. If you want to
  103. close device driver type use a colon after its name. You will not
  104. probably be able to close standard character devices (e.g. NUL, CON)
  105. but you can try if you like.
  106.  
  107. BEWARE:
  108. If you close a file that is still in use by some applications you
  109. can run in to trouble because this programs will continue to read
  110. and DOS will not signal an error but frankly provide them with
  111. random bytes. And what will happen after write request? (not tested)
  112.  
  113.  
  114.  
  115. --------
  116. SHAROPEN
  117. --------
  118. This is a very small TSR (30 bytes of code+PSP) that makes all DOS
  119. programs to act "SHARE aware". They will no longer open files
  120. in compatibility mode but use "deny write" mode. This should be
  121. very safe solution and it will allow you to open for reading
  122. most of files used by Windows. I could use "deny none" mode
  123. but this much more dangerous and rarely needed. But if you like it
  124. just find the only OR instruction and change its bit mask.
  125.  
  126. Notes:
  127. Threre is a problem with Borland C++ 3.1 and TSRs that hook INT 21.
  128. This is NOT a BUG in SHAROPEN! The workaround is to start SHAROPEN
  129. via INSTALL derective from CONFIG.SYS possibly before all memory
  130. managers and other resident software.
  131.  
  132. The SHAROPEN has not code to detect itself in memory. Nothing wrong
  133. happens when loaded more than once but this is just wasting of memory.
  134.  
  135. There is also problem with Norton Commander 4.0 "save setup" if
  136. SHAROPEN is loaded. No workaround available. Maybe in future versions
  137. I will include an option allowing SHAROPEN to recognize requests from
  138. incompatybile programs and process them normally.
  139.  
  140. If you know any other problems E-mail me.
  141.  
  142. ****************************************************************************
  143. DISCLAIMER:
  144.  
  145. As you did not purchase this programs from me you can use them only
  146.     >>>>     A T    Y O U R    O W N    R I S K     <<<<
  147. So don't bother me with your E-mails, letters, phone calls and
  148. your lawyers if anything happens to your valuable data.
  149.  
  150.  
  151. ****************************************************************************
  152. LICENCE:
  153.  
  154. This is FREE SOFTWARE. Use and distribute freely. If you want to enhance
  155. anything do not hesitate to do so. Never remove my copyright; include
  156. yours and write what changes you have made.
  157.  
  158. If you find that one of these programs helped you solve your problem
  159. please go to the nearest computer store, buy a good 3 1/2" floppy,
  160. place a stamp on it and send to the address below. I believe this
  161. is not to much for you. I can buy only 40 diskettes with my grant
  162. (although I have one of the highest grants in Poland).
  163.  
  164. If you feel you need sources I can send them via E-mail. But please
  165. make sure you need them. SHAROPEN and CLOSE are written in assembler
  166. and are small enough to be successfully disassembled. My sources
  167. do not contain a single line of comment! SHAREDIR consist of 20 lines
  168. of C code and is not commented either. It is so big after compilation
  169. because I use "printf" and original C0C.OBJ (Borland C++ 3.1).
  170.  
  171.  
  172.  
  173. *****************************************************************************
  174. ADDRESS:
  175.  
  176. Please note that my E-mail address will be valid only until summer 94.
  177.  
  178.            gorbiel@uci.agh.edu.pl
  179.            s645@ernie.icslab.agh.edu.pl
  180.  
  181.            Andrzej Gorbiel
  182.            ul.Bochenska 3/19
  183.            31-061 Krakow
  184.            POLAND
  185.  
  186.